package com.pjchat.pjchatclient.main;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.Socket;

import javax.swing.JOptionPane;

import com.pjchat.pjchatclient.frame.MyLoginFrame;

public class App {
	private BufferedReader br;
	private BufferedWriter bw;

	public App(Socket socket) throws IOException {
		try {
			this.br = new BufferedReader(new InputStreamReader(
					socket.getInputStream()));
			this.bw = new BufferedWriter(new OutputStreamWriter(
					socket.getOutputStream()));
		} catch (NullPointerException e) {
			JOptionPane.showMessageDialog(null, "Sorry,big server is closed.");
			System.exit(0);
		}
	}

	public void start() throws IOException {
		MyLoginFrame mlf = new MyLoginFrame(br, bw);
	}
}
